<?php

namespace apiend\modules\search\models;

use Yii;

/**
 * 热门搜索模型
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class HotSearch extends \common\models\keyword\KeywordLibrary {

    public function search() {
        return static::find()
        ->limit(10)
        ->orderBy(['spread_at' => SORT_DESC])
        ->all();
    }

    public function fields() {
        return [
            'id',
            'text',
            'color',
        ];
    }

}
